//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS RedshiftData service.
///
/// You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You can run SQL statements, which are committed if the statement succeeds.  For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
public struct RedshiftData: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the RedshiftData client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "RedshiftData",
            serviceName: "RedshiftData",
            serviceIdentifier: "redshift-data",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2019-12-20",
            endpoint: endpoint,
            errorType: RedshiftDataErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func batchExecuteStatement(_ input: BatchExecuteStatementInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchExecuteStatementOutput {
        try await self.client.execute(
            operation: "BatchExecuteStatement", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - database: The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - resultFormat: The data format of the result of the SQL statement. If no format is specified, the default is JSON.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - sessionId: The session identifier of the query.
    ///   - sessionKeepAliveSeconds: The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.
    ///   - sqls: One or more SQL statements to run.   The SQL statements are run as a single transaction. They run serially in the order of the array.  Subsequent SQL statements don't start until the previous statement in the array completes.  If any SQL statement fails, then because they are run as one transaction, all work is rolled back.
    ///   - statementName: The name of the SQL statements. You can name the SQL statements when you create them to identify the query.
    ///   - withEvent: A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchExecuteStatement(
        clientToken: String? = BatchExecuteStatementInput.idempotencyToken(),
        clusterIdentifier: String? = nil,
        database: String? = nil,
        dbUser: String? = nil,
        resultFormat: ResultFormatString? = nil,
        secretArn: String? = nil,
        sessionId: String? = nil,
        sessionKeepAliveSeconds: Int? = nil,
        sqls: [String],
        statementName: String? = nil,
        withEvent: Bool? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchExecuteStatementOutput {
        let input = BatchExecuteStatementInput(
            clientToken: clientToken, 
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            dbUser: dbUser, 
            resultFormat: resultFormat, 
            secretArn: secretArn, 
            sessionId: sessionId, 
            sessionKeepAliveSeconds: sessionKeepAliveSeconds, 
            sqls: sqls, 
            statementName: statementName, 
            withEvent: withEvent, 
            workgroupName: workgroupName
        )
        return try await self.batchExecuteStatement(input, logger: logger)
    }

    /// Cancels a running query. To be canceled, a query must be running.  For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func cancelStatement(_ input: CancelStatementRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelStatementResponse {
        try await self.client.execute(
            operation: "CancelStatement", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels a running query. To be canceled, a query must be running.  For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - id: The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  This identifier is returned by BatchExecuteStatment, ExecuteStatment, and ListStatements.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelStatement(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelStatementResponse {
        let input = CancelStatementRequest(
            id: id
        )
        return try await self.cancelStatement(input, logger: logger)
    }

    /// Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.  For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func describeStatement(_ input: DescribeStatementRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeStatementResponse {
        try await self.client.execute(
            operation: "DescribeStatement", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.  For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - id: The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatement, and ListStatements.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeStatement(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeStatementResponse {
        let input = DescribeStatementRequest(
            id: id
        )
        return try await self.describeStatement(input, logger: logger)
    }

    /// Describes the detailed information about a table from metadata in the cluster. The information includes its columns.  A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func describeTable(_ input: DescribeTableRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeTableResponse {
        try await self.client.execute(
            operation: "DescribeTable", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes the detailed information about a table from metadata in the cluster. The information includes its columns.  A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the tables to be described.   If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of tables to return in the response.  If more tables exist than fit in one response, then NextToken is returned to page through the results.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - schema: The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - table: The table name. If no table is specified, then all tables for all matching schemas are returned.  If no table and no schema is specified, then all tables for all schemas in the database are returned
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeTable(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        schema: String? = nil,
        secretArn: String? = nil,
        table: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeTableResponse {
        let input = DescribeTableRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            schema: schema, 
            secretArn: secretArn, 
            table: table, 
            workgroupName: workgroupName
        )
        return try await self.describeTable(input, logger: logger)
    }

    /// Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func executeStatement(_ input: ExecuteStatementInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ExecuteStatementOutput {
        try await self.client.execute(
            operation: "ExecuteStatement", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - database: The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - parameters: The parameters for the SQL statement.
    ///   - resultFormat: The data format of the result of the SQL statement. If no format is specified, the default is JSON.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - sessionId: The session identifier of the query.
    ///   - sessionKeepAliveSeconds: The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.
    ///   - sql: The SQL statement text to run.
    ///   - statementName: The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
    ///   - withEvent: A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func executeStatement(
        clientToken: String? = ExecuteStatementInput.idempotencyToken(),
        clusterIdentifier: String? = nil,
        database: String? = nil,
        dbUser: String? = nil,
        parameters: [SqlParameter]? = nil,
        resultFormat: ResultFormatString? = nil,
        secretArn: String? = nil,
        sessionId: String? = nil,
        sessionKeepAliveSeconds: Int? = nil,
        sql: String,
        statementName: String? = nil,
        withEvent: Bool? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ExecuteStatementOutput {
        let input = ExecuteStatementInput(
            clientToken: clientToken, 
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            dbUser: dbUser, 
            parameters: parameters, 
            resultFormat: resultFormat, 
            secretArn: secretArn, 
            sessionId: sessionId, 
            sessionKeepAliveSeconds: sessionKeepAliveSeconds, 
            sql: sql, 
            statementName: statementName, 
            withEvent: withEvent, 
            workgroupName: workgroupName
        )
        return try await self.executeStatement(input, logger: logger)
    }

    /// Fetches the temporarily cached result of an SQL statement in JSON format.  The ExecuteStatement or BatchExecuteStatement operation that ran the SQL statement must have specified ResultFormat as JSON , or let the format default to JSON. A token is returned to page through the statement results. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func getStatementResult(_ input: GetStatementResultRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetStatementResultResponse {
        try await self.client.execute(
            operation: "GetStatementResult", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Fetches the temporarily cached result of an SQL statement in JSON format.  The ExecuteStatement or BatchExecuteStatement operation that ran the SQL statement must have specified ResultFormat as JSON , or let the format default to JSON. A token is returned to page through the statement results. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - id: The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  A suffix indicates then number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatment, and ListStatements.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - logger: Logger use during operation
    @inlinable
    public func getStatementResult(
        id: String,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetStatementResultResponse {
        let input = GetStatementResultRequest(
            id: id, 
            nextToken: nextToken
        )
        return try await self.getStatementResult(input, logger: logger)
    }

    /// Fetches the temporarily cached result of an SQL statement in CSV format.  The ExecuteStatement or BatchExecuteStatement operation that ran the SQL statement must have specified ResultFormat as CSV. A token is returned to page through the statement results. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func getStatementResultV2(_ input: GetStatementResultV2Request, logger: Logger = AWSClient.loggingDisabled) async throws -> GetStatementResultV2Response {
        try await self.client.execute(
            operation: "GetStatementResultV2", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Fetches the temporarily cached result of an SQL statement in CSV format.  The ExecuteStatement or BatchExecuteStatement operation that ran the SQL statement must have specified ResultFormat as CSV. A token is returned to page through the statement results. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - id: The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  A suffix indicates then number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatment, and ListStatements.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - logger: Logger use during operation
    @inlinable
    public func getStatementResultV2(
        id: String,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetStatementResultV2Response {
        let input = GetStatementResultV2Request(
            id: id, 
            nextToken: nextToken
        )
        return try await self.getStatementResultV2(input, logger: logger)
    }

    /// List the databases in a cluster.  A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func listDatabases(_ input: ListDatabasesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDatabasesResponse {
        try await self.client.execute(
            operation: "ListDatabases", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List the databases in a cluster.  A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - database: The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of databases to return in the response.  If more databases exist than fit in one response, then NextToken is returned to page through the results.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDatabases(
        clusterIdentifier: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        secretArn: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDatabasesResponse {
        let input = ListDatabasesRequest(
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            secretArn: secretArn, 
            workgroupName: workgroupName
        )
        return try await self.listDatabases(input, logger: logger)
    }

    /// Lists the schemas in a database.  A token is returned to page through the schema list.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func listSchemas(_ input: ListSchemasRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSchemasResponse {
        try await self.client.execute(
            operation: "ListSchemas", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the schemas in a database.  A token is returned to page through the schema list.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the schemas to list.  If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of schemas to return in the response.  If more schemas exist than fit in one response, then NextToken is returned to page through the results.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - schemaPattern: A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSchemas(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        schemaPattern: String? = nil,
        secretArn: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSchemasResponse {
        let input = ListSchemasRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            schemaPattern: schemaPattern, 
            secretArn: secretArn, 
            workgroupName: workgroupName
        )
        return try await self.listSchemas(input, logger: logger)
    }

    /// List of SQL statements. By default, only finished statements are shown.  A token is returned to page through the statement list.  When you use identity-enhanced role sessions to list statements, you must provide either the  cluster-identifier or workgroup-name parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they are assigned. For more information, see   Trusted identity propagation overview. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func listStatements(_ input: ListStatementsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListStatementsResponse {
        try await self.client.execute(
            operation: "ListStatements", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List of SQL statements. By default, only finished statements are shown.  A token is returned to page through the statement list.  When you use identity-enhanced role sessions to list statements, you must provide either the  cluster-identifier or workgroup-name parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they are assigned. For more information, see   Trusted identity propagation overview. For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clusterIdentifier: The cluster identifier. Only statements that ran on this cluster are returned.  When providing ClusterIdentifier, then WorkgroupName can't be specified.
    ///   - database: The name of the database when listing statements run against a ClusterIdentifier or WorkgroupName.
    ///   - maxResults: The maximum number of SQL statements to return in the response.  If more SQL statements exist than fit in one response, then NextToken is returned to page through the results.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - roleLevel: A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned.  If false, only statements run by the caller's IAM role in the current IAM session are returned.  The default is true.
    ///   - statementName: The name of the SQL statement specified as input to BatchExecuteStatement or ExecuteStatement to identify the query.  You can list multiple statements by providing a prefix that matches the beginning of the statement name.  For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of myStatement.   Data API does a case-sensitive match of SQL statement names to the prefix value you provide.
    ///   - status: The status of the SQL statement to list. Status values are defined as follows:    ABORTED - The query run was stopped by the user.    ALL -  A status value that includes all query statuses. This value can be used to filter results.    FAILED - The query run failed.    FINISHED - The query has finished running.    PICKED - The query has been chosen to be run.    STARTED - The query run has started.    SUBMITTED - The query was submitted, but not yet processed.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned.  When providing WorkgroupName, then ClusterIdentifier can't be specified.
    ///   - logger: Logger use during operation
    @inlinable
    public func listStatements(
        clusterIdentifier: String? = nil,
        database: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        roleLevel: Bool? = nil,
        statementName: String? = nil,
        status: StatusString? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListStatementsResponse {
        let input = ListStatementsRequest(
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            roleLevel: roleLevel, 
            statementName: statementName, 
            status: status, 
            workgroupName: workgroupName
        )
        return try await self.listStatements(input, logger: logger)
    }

    /// List the tables in a database. If neither SchemaPattern nor TablePattern are specified, then  all tables in the database are returned. A token is returned to page through the table list.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    @Sendable
    @inlinable
    public func listTables(_ input: ListTablesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTablesResponse {
        try await self.client.execute(
            operation: "ListTables", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List the tables in a database. If neither SchemaPattern nor TablePattern are specified, then  all tables in the database are returned. A token is returned to page through the table list.  Depending on the authorization method, use one of the following combinations of request parameters:    Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret  stored in Secrets Manager which has username and password.  The specified secret contains credentials to connect to the database you specify.  When you are connecting to a cluster, you also supply the database name,  If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret.        When you are connecting to a serverless workgroup, you also supply the database name.   Temporary credentials - when connecting to your data warehouse, choose one of the following options:   When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.   When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.   When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name.  Also, permission to call the redshift:GetClusterCredentials operation is required.     For more information about the Amazon Redshift Data API and CLI usage examples, see  Using the Amazon Redshift Data API in the  Amazon Redshift Management Guide.
    ///
    /// Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the tables to list.  If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of tables to return in the response.  If more tables exist than fit in one response, then NextToken is returned to page through the results.
    ///   - nextToken: A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
    ///   - schemaPattern: A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned. If SchemaPattern is not specified, then all tables that match  TablePattern are returned.  If neither SchemaPattern or TablePattern are specified, then all tables are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - tablePattern: A pattern to filter results by table name. Within a table pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only table name entries matching the search pattern are returned. If TablePattern is not specified, then all tables that match  SchemaPatternare returned.   If neither SchemaPattern or TablePattern are specified, then all tables are returned.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTables(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        schemaPattern: String? = nil,
        secretArn: String? = nil,
        tablePattern: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTablesResponse {
        let input = ListTablesRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            schemaPattern: schemaPattern, 
            secretArn: secretArn, 
            tablePattern: tablePattern, 
            workgroupName: workgroupName
        )
        return try await self.listTables(input, logger: logger)
    }
}

extension RedshiftData {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: RedshiftData, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension RedshiftData {
    /// Return PaginatorSequence for operation ``describeTable(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeTablePaginator(
        _ input: DescribeTableRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeTableRequest, DescribeTableResponse> {
        return .init(
            input: input,
            command: self.describeTable,
            inputKey: \DescribeTableRequest.nextToken,
            outputKey: \DescribeTableResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeTable(_:logger:)``.
    ///
    /// - Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the tables to be described.   If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of tables to return in the response.  If more tables exist than fit in one response, then NextToken is returned to page through the results.
    ///   - schema: The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - table: The table name. If no table is specified, then all tables for all matching schemas are returned.  If no table and no schema is specified, then all tables for all schemas in the database are returned
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeTablePaginator(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        schema: String? = nil,
        secretArn: String? = nil,
        table: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeTableRequest, DescribeTableResponse> {
        let input = DescribeTableRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            schema: schema, 
            secretArn: secretArn, 
            table: table, 
            workgroupName: workgroupName
        )
        return self.describeTablePaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getStatementResult(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getStatementResultPaginator(
        _ input: GetStatementResultRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetStatementResultRequest, GetStatementResultResponse> {
        return .init(
            input: input,
            command: self.getStatementResult,
            inputKey: \GetStatementResultRequest.nextToken,
            outputKey: \GetStatementResultResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getStatementResult(_:logger:)``.
    ///
    /// - Parameters:
    ///   - id: The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  A suffix indicates then number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatment, and ListStatements.
    ///   - logger: Logger used for logging
    @inlinable
    public func getStatementResultPaginator(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetStatementResultRequest, GetStatementResultResponse> {
        let input = GetStatementResultRequest(
            id: id
        )
        return self.getStatementResultPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getStatementResultV2(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getStatementResultV2Paginator(
        _ input: GetStatementResultV2Request,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetStatementResultV2Request, GetStatementResultV2Response> {
        return .init(
            input: input,
            command: self.getStatementResultV2,
            inputKey: \GetStatementResultV2Request.nextToken,
            outputKey: \GetStatementResultV2Response.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getStatementResultV2(_:logger:)``.
    ///
    /// - Parameters:
    ///   - id: The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  A suffix indicates then number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatment, and ListStatements.
    ///   - logger: Logger used for logging
    @inlinable
    public func getStatementResultV2Paginator(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetStatementResultV2Request, GetStatementResultV2Response> {
        let input = GetStatementResultV2Request(
            id: id
        )
        return self.getStatementResultV2Paginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDatabases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDatabasesPaginator(
        _ input: ListDatabasesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDatabasesRequest, ListDatabasesResponse> {
        return .init(
            input: input,
            command: self.listDatabases,
            inputKey: \ListDatabasesRequest.nextToken,
            outputKey: \ListDatabasesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDatabases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - database: The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of databases to return in the response.  If more databases exist than fit in one response, then NextToken is returned to page through the results.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDatabasesPaginator(
        clusterIdentifier: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        secretArn: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDatabasesRequest, ListDatabasesResponse> {
        let input = ListDatabasesRequest(
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            secretArn: secretArn, 
            workgroupName: workgroupName
        )
        return self.listDatabasesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listSchemas(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSchemasPaginator(
        _ input: ListSchemasRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSchemasRequest, ListSchemasResponse> {
        return .init(
            input: input,
            command: self.listSchemas,
            inputKey: \ListSchemasRequest.nextToken,
            outputKey: \ListSchemasResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSchemas(_:logger:)``.
    ///
    /// - Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the schemas to list.  If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of schemas to return in the response.  If more schemas exist than fit in one response, then NextToken is returned to page through the results.
    ///   - schemaPattern: A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger used for logging
    @inlinable
    public func listSchemasPaginator(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        schemaPattern: String? = nil,
        secretArn: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSchemasRequest, ListSchemasResponse> {
        let input = ListSchemasRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            schemaPattern: schemaPattern, 
            secretArn: secretArn, 
            workgroupName: workgroupName
        )
        return self.listSchemasPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listStatements(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listStatementsPaginator(
        _ input: ListStatementsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListStatementsRequest, ListStatementsResponse> {
        return .init(
            input: input,
            command: self.listStatements,
            inputKey: \ListStatementsRequest.nextToken,
            outputKey: \ListStatementsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listStatements(_:logger:)``.
    ///
    /// - Parameters:
    ///   - clusterIdentifier: The cluster identifier. Only statements that ran on this cluster are returned.  When providing ClusterIdentifier, then WorkgroupName can't be specified.
    ///   - database: The name of the database when listing statements run against a ClusterIdentifier or WorkgroupName.
    ///   - maxResults: The maximum number of SQL statements to return in the response.  If more SQL statements exist than fit in one response, then NextToken is returned to page through the results.
    ///   - roleLevel: A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned.  If false, only statements run by the caller's IAM role in the current IAM session are returned.  The default is true.
    ///   - statementName: The name of the SQL statement specified as input to BatchExecuteStatement or ExecuteStatement to identify the query.  You can list multiple statements by providing a prefix that matches the beginning of the statement name.  For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of myStatement.   Data API does a case-sensitive match of SQL statement names to the prefix value you provide.
    ///   - status: The status of the SQL statement to list. Status values are defined as follows:    ABORTED - The query run was stopped by the user.    ALL -  A status value that includes all query statuses. This value can be used to filter results.    FAILED - The query run failed.    FINISHED - The query has finished running.    PICKED - The query has been chosen to be run.    STARTED - The query run has started.    SUBMITTED - The query was submitted, but not yet processed.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned.  When providing WorkgroupName, then ClusterIdentifier can't be specified.
    ///   - logger: Logger used for logging
    @inlinable
    public func listStatementsPaginator(
        clusterIdentifier: String? = nil,
        database: String? = nil,
        maxResults: Int? = nil,
        roleLevel: Bool? = nil,
        statementName: String? = nil,
        status: StatusString? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListStatementsRequest, ListStatementsResponse> {
        let input = ListStatementsRequest(
            clusterIdentifier: clusterIdentifier, 
            database: database, 
            maxResults: maxResults, 
            roleLevel: roleLevel, 
            statementName: statementName, 
            status: status, 
            workgroupName: workgroupName
        )
        return self.listStatementsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTables(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTablesPaginator(
        _ input: ListTablesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTablesRequest, ListTablesResponse> {
        return .init(
            input: input,
            command: self.listTables,
            inputKey: \ListTablesRequest.nextToken,
            outputKey: \ListTablesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTables(_:logger:)``.
    ///
    /// - Parameters:
    ///   - clusterIdentifier: The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
    ///   - connectedDatabase: A database name. The connected database is specified when you connect with your authentication credentials.
    ///   - database: The name of the database that contains the tables to list.  If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
    ///   - dbUser: The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
    ///   - maxResults: The maximum number of tables to return in the response.  If more tables exist than fit in one response, then NextToken is returned to page through the results.
    ///   - schemaPattern: A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned. If SchemaPattern is not specified, then all tables that match  TablePattern are returned.  If neither SchemaPattern or TablePattern are specified, then all tables are returned.
    ///   - secretArn: The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
    ///   - tablePattern: A pattern to filter results by table name. Within a table pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only table name entries matching the search pattern are returned. If TablePattern is not specified, then all tables that match  SchemaPatternare returned.   If neither SchemaPattern or TablePattern are specified, then all tables are returned.
    ///   - workgroupName: The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTablesPaginator(
        clusterIdentifier: String? = nil,
        connectedDatabase: String? = nil,
        database: String,
        dbUser: String? = nil,
        maxResults: Int? = nil,
        schemaPattern: String? = nil,
        secretArn: String? = nil,
        tablePattern: String? = nil,
        workgroupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTablesRequest, ListTablesResponse> {
        let input = ListTablesRequest(
            clusterIdentifier: clusterIdentifier, 
            connectedDatabase: connectedDatabase, 
            database: database, 
            dbUser: dbUser, 
            maxResults: maxResults, 
            schemaPattern: schemaPattern, 
            secretArn: secretArn, 
            tablePattern: tablePattern, 
            workgroupName: workgroupName
        )
        return self.listTablesPaginator(input, logger: logger)
    }
}

extension RedshiftData.DescribeTableRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.DescribeTableRequest {
        return .init(
            clusterIdentifier: self.clusterIdentifier,
            connectedDatabase: self.connectedDatabase,
            database: self.database,
            dbUser: self.dbUser,
            maxResults: self.maxResults,
            nextToken: token,
            schema: self.schema,
            secretArn: self.secretArn,
            table: self.table,
            workgroupName: self.workgroupName
        )
    }
}

extension RedshiftData.GetStatementResultRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.GetStatementResultRequest {
        return .init(
            id: self.id,
            nextToken: token
        )
    }
}

extension RedshiftData.GetStatementResultV2Request: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.GetStatementResultV2Request {
        return .init(
            id: self.id,
            nextToken: token
        )
    }
}

extension RedshiftData.ListDatabasesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.ListDatabasesRequest {
        return .init(
            clusterIdentifier: self.clusterIdentifier,
            database: self.database,
            dbUser: self.dbUser,
            maxResults: self.maxResults,
            nextToken: token,
            secretArn: self.secretArn,
            workgroupName: self.workgroupName
        )
    }
}

extension RedshiftData.ListSchemasRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.ListSchemasRequest {
        return .init(
            clusterIdentifier: self.clusterIdentifier,
            connectedDatabase: self.connectedDatabase,
            database: self.database,
            dbUser: self.dbUser,
            maxResults: self.maxResults,
            nextToken: token,
            schemaPattern: self.schemaPattern,
            secretArn: self.secretArn,
            workgroupName: self.workgroupName
        )
    }
}

extension RedshiftData.ListStatementsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.ListStatementsRequest {
        return .init(
            clusterIdentifier: self.clusterIdentifier,
            database: self.database,
            maxResults: self.maxResults,
            nextToken: token,
            roleLevel: self.roleLevel,
            statementName: self.statementName,
            status: self.status,
            workgroupName: self.workgroupName
        )
    }
}

extension RedshiftData.ListTablesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> RedshiftData.ListTablesRequest {
        return .init(
            clusterIdentifier: self.clusterIdentifier,
            connectedDatabase: self.connectedDatabase,
            database: self.database,
            dbUser: self.dbUser,
            maxResults: self.maxResults,
            nextToken: token,
            schemaPattern: self.schemaPattern,
            secretArn: self.secretArn,
            tablePattern: self.tablePattern,
            workgroupName: self.workgroupName
        )
    }
}
